﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace schedule
{
    public partial class FriendList : Form
    {
        public FriendList()
        {
            InitializeComponent();

            dataGridView1.Rows.Clear();

            dataGridView1.Rows[0].Cells[1].Value = "mvorchm@naver.com";
            dataGridView1.Rows[0].Cells[2].Value = "친구";
            dataGridView1.Size = new Size(dataGridView1.Size.Width, dataGridView1.Rows[0].Cells[0].Size.Height + dataGridView1.Size.Height);

            dataGridView1.Rows.Add(false, "gamepm@hotmail.com", "친구");
            dataGridView1.Size = new Size(dataGridView1.Size.Width, dataGridView1.Rows[0].Cells[0].Size.Height + dataGridView1.Size.Height);

            dataGridView1.Rows.Add(false, "levocaelus@gmail.com", "친구");
            dataGridView1.Size = new Size(dataGridView1.Size.Width, dataGridView1.Rows[0].Cells[0].Size.Height + dataGridView1.Size.Height);
            //dataGridView1.Size = new Size(100, 100);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Close();
        }

        public List<string> getInvateFriends()
        {
            List<string> names = new List<string>();
            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                bool check  = (bool)row.Cells[0].EditedFormattedValue;
                if (check == true)
                {
                    names.Add(row.Cells[1].Value as string);
                }
            }

            return names;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
